from Base import Base
from selenium.webdriver.common.by import By

# 添加学生
class Page02(Base):

    usernameSR_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/div/div[2]/div[1]/div/div/input')

    passwordSR_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/div/div[2]/div[2]/div/div/input')

    loginDJ_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/div/div[3]/button')

    addDJ1_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div/div[2]/div/div/button[2]')

    snameSR_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[1]/div/div/div/input')

    tnameSR_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[2]/div/div/div/input')

    crSR_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[3]/div/div/div/input')

    addDJ2_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[4]/div/button[1]')

    dy1_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div/div[1]/div/label')



    def usernameSR(self):
        self.send_keys(self.usernameSR_loc,'liyou01')

    def passwordSR(self):
        self.send_keys(self.passwordSR_loc,'1234561')

    def loginDJ(self):
        self.click(self.loginDJ_loc)

    def addDJ1(self):
        self.click(self.addDJ1_loc)

    def snameSR(self):
        self.send_keys(self.snameSR_loc,'pip')

    def tnameSR(self):
        self.send_keys(self.tnameSR_loc,'1')

    def crSR(self):
        self.send_keys(self.crSR_loc,'1')

    def addDJ2(self):
        self.click(self.addDJ2_loc)

    def dy1(self):
        return self.find_element(self.dy1_loc).text
